//==================================================
// 作 者：曾浩
// 日 期：2012-03-15
// 描 述：介绍本文件所要完成的功能以及背景信息等等
//==================================================
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreFrame.Core.Orm;

namespace MarchEstate.Manager.BusinesEntity
{
    [Serializable]
    [Table(TableName = "WY_MeterOrder", EntityType = EntityType.Table, IsGB = false)]
    public abstract class AbstractMeterOrder : CoreFrame.Business.AbstractBusines
    {
        private string _meterorderid;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "MeterOrderId", DataKey = true, IsSingleQuote = true, Match = "Custom:Guid", IsInsert = false)]
        public string MeterOrderId
        {
            get { return _meterorderid; }
            set { _meterorderid = value; }
        }
        private string _meterheadid;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "MeterHeadId", DataKey =false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string MeterHeadId
        {
            get { return _meterheadid; }
            set { _meterheadid = value; }
        }
        private string _meterid;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "MeterId", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string MeterId
        {
            get { return _meterid; }
            set { _meterid = value; }
        }
        private string _ownerid;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "OwnerId", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string OwnerId
        {
            get { return _ownerid; }
            set { _ownerid = value; }
        }
        private string _ownername;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "OwnerName", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string OwnerName
        {
            get { return _ownername; }
            set { _ownername = value; }
        }

        private string _srccId;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "SrccId", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string SrccId
        {
            get { return _srccId; }
            set { _srccId = value; }
        }

        private string _srccName;//
        /// <summary>
        /// 
        /// </summary>
        [Column(FieldName = "SrccName", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public string SrccName
        {
            get { return _srccName; }
            set { _srccName = value; }
        }

        private DateTime _lastmeterdate;//上次抄表时间
        /// <summary>
        /// 上次抄表时间
        /// </summary>
        [Column(FieldName = "LastMeterDate", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public DateTime LastMeterDate
        {
            get { return _lastmeterdate; }
            set { _lastmeterdate = value; }
        }
        private DateTime _thismeterdate;//抄表时间
        /// <summary>
        /// 抄表时间
        /// </summary>
        [Column(FieldName = "ThisMeterDate", DataKey = false, IsSingleQuote = true, Match = "", IsInsert = true)]
        public DateTime ThisMeterDate
        {
            get { return _thismeterdate; }
            set { _thismeterdate = value; }
        }
        private decimal _lastnum;//
        /// <summary>
        /// 上次数量
        /// </summary>
        [Column(FieldName = "LastNum", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal LastNum
        {
            get { return _lastnum; }
            set { _lastnum = value; }
        }
        private decimal _thisnum;//
        /// <summary>
        /// 本次数量
        /// </summary>
        [Column(FieldName = "ThisNum", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal ThisNum
        {
            get { return _thisnum; }
            set { _thisnum = value; }
        }
        private decimal _meternum;//
        /// <summary>
        /// 用量=本次数量-上次数量
        /// </summary>
        [Column(FieldName = "MeterNum", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal MeterNum
        {
            get { return _meternum; }
            set { _meternum = value; }
        }
        
        private decimal _thiscost;//本次应收
        /// <summary>
        /// 本次应收
        /// </summary>
        [Column(FieldName = "Thiscost", DataKey = false, IsSingleQuote = false, Match = "", IsInsert = true)]
        public decimal Thiscost
        {
            get { return _thiscost; }
            set { _thiscost = value; }
        }

        public abstract bool Save();

        public abstract bool Delete(string _meterOrderId);

        /// <summary>
        /// 根据单据头获取抄表明细
        /// </summary>
        /// <param name="_meterHeadId"></param>
        /// <returns></returns>
        public abstract List<AbstractMeterOrder> GetMeterOrderList(string _meterHeadId);

        /// <summary>
        /// 根据单据头获取抄表明细
        /// </summary>
        /// <param name="_meterHeadId"></param>
        /// <returns></returns>
        public abstract List<AbstractMeterOrder> GetMeterOrderList(string _meterHeadId, PageInfo page);
        /// <summary>
        /// 录入抄表结果
        /// </summary>
        /// <param name="meterOrderId"></param>
        /// <param name="thisNum"></param>
        /// <returns></returns>
        public abstract AbstractMeterOrder UpdateMeterformResult(string meterOrderId, decimal thisNum);

        
    }
}